package dieci.hibernate;

import dieci.database.PersistentObject;
import dieci.system.SaleDetails;

/**
 *
 * @author DuckSys
 */
public class HibSaleDetails implements PersistentObject
{

    private HibSaleDetailId id;
    private int amount;
    private double price;

    public HibSaleDetails()
    {
    }

    public HibSaleDetails(SaleDetails details, Long saleId)
    {
        id = new HibSaleDetailId();
        id.setSaleId(saleId);
        id.setProductId(details.getProduct().getProductId());
        this.amount = details.getAmount();
        this.price = details.getPrice();
    }

    /**
     * Get the value of id
     *
     * @return the value of id
     */
    public HibSaleDetailId getId()
    {
        return id;
    }

    /**
     * Set the value of id
     *
     * @param id new value of id
     */
    public void setId(HibSaleDetailId id)
    {
        this.id = id;
    }

    /**
     * Get the value of price
     *
     * @return the value of price
     */
    public double getPrice()
    {
        return price;
    }

    /**
     * Set the value of price
     *
     * @param price new value of price
     */
    public void setPrice(double price)
    {
        this.price = price;
    }

    /**
     * Get the value of amount
     *
     * @return the value of amount
     */
    public int getAmount()
    {
        return amount;
    }

    /**
     * Set the value of amount
     *
     * @param amount new value of amount
     */
    public void setAmount(int amount)
    {
        this.amount = amount;
    }
}
